<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateAppsTable extends Migration
{
    /**
     * Run the migrations.
     * @return void
     */
    public function up()
    {
        Schema::create('apps', function (Blueprint $table) {
            $table->increments('id');
            $table->string('name', 50)->default('')->comment('名称');
            $table->text('intro')->nullable()->comment('简介');
            $table->string('pic1', 100)->default('')->comment('图片');
            $table->tinyInteger('status')->default(0)->comment('状态:0不显示/1显示');
            $table->dateTime('created_at')->nullable()->comment('创建时间');
            $table->dateTime('updated_at')->nullable()->comment('更新时间');
        });
        Schema::create('app_releases', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('app_id')->unsigned()->comment('应用Id');
            $table->string('version', 30)->default('')->comment('版本');
            $table->text('description')->nullable()->comment('描述');
            $table->string('file1', 100)->default('')->comment('文件');
            $table->tinyInteger('is_top')->default(0)->comment('置顶');
            $table->dateTime('created_at')->nullable()->comment('创建时间');
            $table->dateTime('updated_at')->nullable()->comment('更新时间');
        });
    }

    /**
     * Reverse the migrations.
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('app_releases');
        Schema::dropIfExists('apps');
    }
}
